/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Console Permission API
云托管服务的控制台权限API

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKJdccs/JdccsApiModel.h>


@implementation JdccsDescribeBandwidthTrafficRequest
-(id) initWithRegion:(NSString *)regionId
idc:(NSString*)idc
bandwidthId:(NSString*)bandwidthId { 
    self.regionId = regionId;
    self.idc = idc;
    self.bandwidthId = bandwidthId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
idc:(NSString*)idc
bandwidthId:(NSString*)bandwidthId { 
    self.regionId = regionId;
    self.version = version;
    self.idc = idc;
    self.bandwidthId = bandwidthId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self bandwidthId])
    {
        [result setValue:[self bandwidthId] forKey:@"bandwidthId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.bandwidthId = [dictionary objectForKey:@"bandwidthId"];
    return self;
} 

@end
@implementation JdccsLastDownsampleRequest
-(id) initWithRegion:(NSString *)regionId
resourceId:(NSString*)resourceId
idc:(NSString*)idc
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.resourceId = resourceId;
    self.idc = idc;
    self.metric = metric;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
resourceId:(NSString*)resourceId
idc:(NSString*)idc
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.version = version;
    self.resourceId = resourceId;
    self.idc = idc;
    self.metric = metric;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.idc = [dictionary objectForKey:@"idc"];
    self.metric = [dictionary objectForKey:@"metric"];
    return self;
} 

@end
@implementation JdccsDescribeMetricDataRequest
-(id) initWithRegion:(NSString *)regionId
resourceId:(NSString*)resourceId
startTime:(NSNumber*)startTime
endTime:(NSNumber*)endTime
timeInterval:(NSString*)timeInterval
idc:(NSString*)idc
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.resourceId = resourceId;
    self.startTime = startTime;
    self.endTime = endTime;
    self.timeInterval = timeInterval;
    self.idc = idc;
    self.metric = metric;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
resourceId:(NSString*)resourceId
startTime:(NSNumber*)startTime
endTime:(NSNumber*)endTime
timeInterval:(NSString*)timeInterval
idc:(NSString*)idc
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.version = version;
    self.resourceId = resourceId;
    self.startTime = startTime;
    self.endTime = endTime;
    self.timeInterval = timeInterval;
    self.idc = idc;
    self.metric = metric;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self timeInterval])
    {
        [result setValue:[self timeInterval] forKey:@"timeInterval"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.timeInterval = [dictionary objectForKey:@"timeInterval"];
    self.idc = [dictionary objectForKey:@"idc"];
    self.metric = [dictionary objectForKey:@"metric"];
    return self;
} 

@end
@implementation JdccsDescribeBandwidthTrafficsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
idc:(NSString*)idc { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.idc = idc;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
idc:(NSString*)idc { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.idc = idc;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.idc = [dictionary objectForKey:@"idc"];
    return self;
} 

@end
@implementation JdccsDescribeIdcsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    return self;
} 

@end
@implementation JdccsDescribeBandwidthTrafficResult
-(id) initWithBandwidthTraffic:(BandwidthTraffic*) bandwidthTraffic { 
    self.bandwidthTraffic = bandwidthTraffic;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bandwidthTraffic])
    {
        [result setValue:[[self bandwidthTraffic] dictionary]forKey:@"bandwidthTraffic"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bandwidthTraffic = [[BandwidthTraffic alloc]initWithDic:[dictionary objectForKey:@"bandwidthTraffic"]];
    return self;
} 

@end
@implementation JdccsDescribeBandwidthTrafficsResult
-(id) initWithBandwidthTraffics:(NSArray<DescribeBandwidthTraffic*>*) bandwidthTraffics
        pageNumber:(NSNumber*)pageNumber
        pageSize:(NSNumber*)pageSize
        totalCount:(NSNumber*)totalCount { 
    self.bandwidthTraffics = bandwidthTraffics;               
    self.pageNumber = pageNumber;               
    self.pageSize = pageSize;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bandwidthTraffics])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self bandwidthTraffics] count]; i++) {
            DescribeBandwidthTraffic* item = [[self bandwidthTraffics] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"bandwidthTraffics"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* bandwidthTrafficsArray = [dictionary objectForKey:@"bandwidthTraffics"];
    if(bandwidthTrafficsArray&&![bandwidthTrafficsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [bandwidthTrafficsArray count];i++)
        {
        DescribeBandwidthTraffic* item = [[DescribeBandwidthTraffic alloc]initWithDic:[bandwidthTrafficsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.bandwidthTraffics = propertyArray;
    }
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
  
@implementation JdccsDescribeBandwidthTrafficsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeBandwidthTrafficsResult* result = [[JdccsDescribeBandwidthTrafficsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeBandwidthTrafficsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation JdccsDescribeMetricsRequest
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
@implementation JdccsDescribeMetricsResult
-(id) initWithMetrics:(NSArray<Metric*>*) metrics { 
    self.metrics = metrics;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metrics])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self metrics] count]; i++) {
            Metric* item = [[self metrics] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"metrics"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* metricsArray = [dictionary objectForKey:@"metrics"];
    if(metricsArray&&![metricsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [metricsArray count];i++)
        {
        Metric* item = [[Metric alloc]initWithDic:[metricsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.metrics = propertyArray;
    }
    return self;
} 

@end
  
@implementation JdccsDescribeMetricsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeMetricsResult* result = [[JdccsDescribeMetricsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeMetricsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation JdccsLastDownsampleResult
-(id) initWithItems:(NSArray<LastDownsampleRespItem*>*) items { 
    self.items = items;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self items])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self items] count]; i++) {
            LastDownsampleRespItem* item = [[self items] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"items"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* itemsArray = [dictionary objectForKey:@"items"];
    if(itemsArray&&![itemsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [itemsArray count];i++)
        {
        LastDownsampleRespItem* item = [[LastDownsampleRespItem alloc]initWithDic:[itemsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.items = propertyArray;
    }
    return self;
} 

@end
  
@implementation JdccsLastDownsampleResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsLastDownsampleResult* result = [[JdccsLastDownsampleResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsLastDownsampleResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation JdccsDescribeMetricDataResult
-(id) initWithMetricData:(MetricData*) metricData { 
    self.metricData = metricData;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metricData])
    {
        [result setValue:[[self metricData] dictionary]forKey:@"metricData"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.metricData = [[MetricData alloc]initWithDic:[dictionary objectForKey:@"metricData"]];
    return self;
} 

@end
  
@implementation JdccsDescribeMetricDataResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeMetricDataResult* result = [[JdccsDescribeMetricDataResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeMetricDataResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation JdccsDescribeBandwidthTrafficResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeBandwidthTrafficResult* result = [[JdccsDescribeBandwidthTrafficResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeBandwidthTrafficResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation JdccsDescribeCabinetsResult
-(id) initWithCabinets:(NSArray<DescribeCabinet*>*) cabinets
        pageNumber:(NSNumber*)pageNumber
        pageSize:(NSNumber*)pageSize
        totalCount:(NSNumber*)totalCount { 
    self.cabinets = cabinets;               
    self.pageNumber = pageNumber;               
    self.pageSize = pageSize;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self cabinets])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self cabinets] count]; i++) {
            DescribeCabinet* item = [[self cabinets] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"cabinets"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* cabinetsArray = [dictionary objectForKey:@"cabinets"];
    if(cabinetsArray&&![cabinetsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [cabinetsArray count];i++)
        {
        DescribeCabinet* item = [[DescribeCabinet alloc]initWithDic:[cabinetsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.cabinets = propertyArray;
    }
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
@implementation JdccsDescribeRoomsResult
-(id) initWithRooms:(NSArray<Room*>*) rooms
        pageNumber:(NSNumber*)pageNumber
        pageSize:(NSNumber*)pageSize
        totalCount:(NSNumber*)totalCount { 
    self.rooms = rooms;               
    self.pageNumber = pageNumber;               
    self.pageSize = pageSize;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self rooms])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self rooms] count]; i++) {
            Room* item = [[self rooms] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"rooms"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* roomsArray = [dictionary objectForKey:@"rooms"];
    if(roomsArray&&![roomsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [roomsArray count];i++)
        {
        Room* item = [[Room alloc]initWithDic:[roomsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.rooms = propertyArray;
    }
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
@implementation JdccsDescribeCabinetsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
filters:(NSArray<Filter*>*)filters
idc:(NSString*)idc { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.filters = filters;
    self.idc = idc;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
filters:(NSArray<Filter*>*)filters
idc:(NSString*)idc { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.filters = filters;
    self.idc = idc;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            Filter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        Filter* item = [[Filter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    self.idc = [dictionary objectForKey:@"idc"];
    return self;
} 

@end
@implementation JdccsDescribeRoomsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
filters:(NSArray<Filter*>*)filters
idc:(NSString*)idc { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.filters = filters;
    self.idc = idc;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
filters:(NSArray<Filter*>*)filters
idc:(NSString*)idc { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.filters = filters;
    self.idc = idc;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            Filter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        Filter* item = [[Filter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    self.idc = [dictionary objectForKey:@"idc"];
    return self;
} 

@end
  
@implementation JdccsDescribeRoomsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeRoomsResult* result = [[JdccsDescribeRoomsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeRoomsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation JdccsDescribeIdcsResult
-(id) initWithIdcs:(NSArray<Idc*>*) idcs
        pageNumber:(NSNumber*)pageNumber
        pageSize:(NSNumber*)pageSize
        totalCount:(NSNumber*)totalCount { 
    self.idcs = idcs;               
    self.pageNumber = pageNumber;               
    self.pageSize = pageSize;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idcs])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self idcs] count]; i++) {
            Idc* item = [[self idcs] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"idcs"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* idcsArray = [dictionary objectForKey:@"idcs"];
    if(idcsArray&&![idcsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [idcsArray count];i++)
        {
        Idc* item = [[Idc alloc]initWithDic:[idcsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.idcs = propertyArray;
    }
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
  
@implementation JdccsDescribeIdcsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeIdcsResult* result = [[JdccsDescribeIdcsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeIdcsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation JdccsDescribeCabinetsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
JdccsDescribeCabinetsResult* result = [[JdccsDescribeCabinetsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(JdccsDescribeCabinetsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
